﻿using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Abp.AspNetCore.Mvc.Authorization;
using AbpZeroTemplate.Authorization.Permissions;
using AbpZeroTemplate.Authorization.Permissions.Dto;
using AbpZeroTemplate.Web.Controllers;
using AbpZeroTemplate.Web.Swagger;
using Microsoft.AspNetCore.Mvc;

namespace AbpZeroTemplate.Api.Admin.Controllers
{
    /// <summary>权限
    /// </summary>
    [Area("Admin")]
    [Route("Admin/Permission/[action]")]
    [ApiName("Admin")]
    [RemoteService]
    [AbpMvcAuthorize]
    public class PermissionController : AbpZeroTemplateControllerBase
    {
        private readonly IPermissionAppService _permissionAppService;
        /// <summary>
        /// </summary>
        public PermissionController(IPermissionAppService permissionAppService)
        {
            _permissionAppService = permissionAppService;
        }

        /// <summary>获取全部的权限
        /// </summary>
        [HttpGet]
        public ListResultDto<FlatPermissionWithLevelDto> GetAllPermissions()
        {
            return _permissionAppService.GetAllPermissions();
        }


    }
}
